﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_MemoryMappedIO class represents computer architecture memory-mapped I/O. This class addresses memory and port I/O resources. 
    /// </summary>
    public class CIM_MemoryMappedIO : CIM_SystemResource
    {

        private string _CreationClassName;
        private string _CSCreationClassName;
        private string _CSName;
        private Nullable<UInt64> _EndingAddress;
        private Nullable<UInt64> _StartingAddress;

        /// <summary>
        /// Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified.
        /// </summary>
        public string CreationClassName { get { return _CreationClassName; } }

        /// <summary>
        /// Scoping computer system's CreationClassName property.
        /// </summary>
        public string CSCreationClassName { get { return _CSCreationClassName; } }

        /// <summary>
        /// Scoping computer system's Name property.
        /// </summary>
        public string CSName { get { return _CSName; } }

        /// <summary>
        /// Ending address of memory mapped I/O.
        /// </summary>
        public Nullable<UInt64> EndingAddress { get { return _EndingAddress; } }

        /// <summary>
        /// Starting address of memory mapped I/O. The hardware resource identifier property should be set to this value to construct the mapped I/O resource key.
        /// </summary>
        public Nullable<UInt64> StartingAddress { get { return _StartingAddress; } }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_MemoryMappedIO(ManagementBaseObject mbo)
            : base(mbo)
        {
            _CreationClassName = mbo.GetStringValue("CreationClassName");
            _CSCreationClassName = mbo.GetStringValue("CSCreationClassName");
            _CSName = mbo.GetStringValue("CSName");
            _EndingAddress = mbo.GetUlongValue("EndingAddress");
            _StartingAddress = mbo.GetUlongValue("StartingAddress");
        }

    }
}
